﻿using System.ComponentModel;
using System.Windows.Forms;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.TestManagement.Client;
using TestStepsEditor.Actions;

namespace TestStepsEditor.Viewers.Data
{
    public class SharedData
    {
        public SharedData()
        {
            TfsTeamProjectCollection tfsProjectCollection;
            ITestManagementTeamProject testProject;
            ServerSettings.Load(out tfsProjectCollection, out testProject);
            TfsProjectCollection = tfsProjectCollection;
            TestProject = testProject;
        }

        public DataGridView GridView { get; set; }
        public int GroupIndexer { get; set; }
        public BindingList<SimpleStep> StepsCollection { get; set; }
        public TfsTeamProjectCollection TfsProjectCollection { get; set; }
        public ITestManagementTeamProject TestProject { get; set; }
        public int WorkItemID { get; set; }
        public WorkItemAttributes WorkItemAttributes { get; set; }
        public ITestBase TestWorkItem { get; set; }
        public DataGridViewRow[] CopiedRows { get; set; }


        public void Clear()
        {
            GridView = null;
            GroupIndexer = 0;
            StepsCollection.Clear();
            WorkItemID = 0;
            WorkItemAttributes = null;
            TestWorkItem = null;
            CopiedRows = null;
        }
    }
}